#import <Foundation/Foundation.h>

// ----- Class interface --------------------------------------
@interface Person : NSObject
{
	int age;
	int weight;
}
-(void) print;
-(void) setAge: (int) a;
-(void) setWeight: (int) w;
-(int) age;
-(int) weight;
@end


// ----- Class implementation. --------------------------------
@implementation Person
-(void) print 
{
	NSLog(@"I am %i years old and weigh %i pounds", age, weight);
}
-(void) setAge:(int) a { age = a; }
-(void) setWeight:(int) w {	weight = w; }
-(int) age { return age; }
-(int) weight { return weight; }
@end


// ----- main method -----------------------------------------
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

	Person * p = [[Person alloc]init];
	[p setAge: 23];
	[p setWeight: 450];
	[p print];
	[p release];
	
	NSLog(@"Person is %i years old and weighs %i pounds", [p age], [p weight]);

	Person * sandy = [[Person alloc]init];
	[sandy setAge: 68];
	[sandy setWeight: 970];
	[sandy print];
	[sandy release];
		
	[pool drain];
    return 0;
}
